<template>
  <div>
    <h2>Home: {{ name }} - {{ counter }}</h2>
    <button @click="increment">home +1</button>
  </div>
</template>

<script>
import { inject } from "vue";
export default {
  setup() {
    let counter = inject("counter");
    const name = inject("name");
    const increment = () => {
      counter.value++;
    };
    return {
      name,
      counter,
      increment
    };
  },
};
</script>

<style scoped>
</style>